-
Notifications
You must be signed in to change notification settings - Fork 24
Resolve Drop calls #1467
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Resolve Drop calls #1467
Conversation
This is ready but based on #1477 |
Charon failure is expected: this adds new variants to |
I've rebased this, it's ready |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the delay.
That looks great, thank you!
Could |
ah.. yes, that's very likely :( |
This PR makes it so we gather the data needed to know what code is called on a
drop
terminator.By default, this is best-effort: we translate a trait ref if we find one. This also adds a
resolve_drop_bounds
option (maybe this should be renamed) which addsT: Drop
bounds to every possible generic parameter and associated type, which guarantees that we can find the rightDrop
impl.The one thing that's missing is the implicit Drop impls (so-called "drop glue") that exist for ADTs without an explicit
impl Drop
; these are represented asDropData::Glue
, and the corresponding MIR body is added toFullDef
so it can be translated by charon.